<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|

| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/


/*
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/','home\HomeController@index' );//入口
Route::get('login','qqController@qq');//qq互联未完成
Route::get('/rili','riliController@rili');//详情日历
Route::get('huweize/home/feiqq','home\userHomeController@feiq' );//qq号码测试

//作家专区
Route::group(['middleware'=>'Writer'],function(){
    Route::get('home/userTalk/{id}', 'Home\userTalkController@del');

//作品管理
    Route::group(['prefix' => 'huweize'], function () {

        Route::get('writer/book', 'writer\WriterController@book'); //书籍页面

        Route::get('writer/book/add', 'writer\WriterController@add'); //新增数据

        Route::post('writer/book/upadd', 'writer\WriterController@upadd');
        Route::get('writer/book/deletebook/{id}','writer\WriterController@deletebook');//删除书籍与相对应的卷章

//显示书章
        Route::get('writer/book/chapters/{id}', 'writer\WriterController@chapters');

//增加书章
        Route::post('writer/book/addchapters', 'writer\WriterController@addchapters');
        Route::get('writer/book/addchapters', 'writer\WriterController@addchapters');

//增加书卷
        Route::post('writer/book/addbookrolls', 'writer\WriterController@addbookrolls');

//已发布章节的查看章节
        Route::post('writer/book/seechapters', 'writer\WriterController@seechapters');
        Route::get('writer/book/seechapters', 'writer\WriterController@seechapters');
        Route::get('writer/book/seechapters/text', 'writer\WriterController@text');

        //修改书籍信息
    Route::any('writer/updatabook/{id}','writer\WriterController@updatabook');

    });


Route::group(['prefix' => 'huweize', 'namespace' => 'home'], function () {
    Route::get('home/userHome', 'userHomeController@show');
    Route::get('home/userTalk/kkk/{id}', 'userTalkController@show');
    Route::get('home/userWorks', 'userWorksController@show');
    Route::get('home/userPayment/{id}', 'userPaymentController@show');
    Route::get('home/userPayment/order/{id}', 'userPaymentController@sort');
    Route::any('home/userVIP/{id}', 'userVIPController@show');
    Route::any('home/userVIPP/{wid}', 'userVIPController@Update');
    Route::get('home/user/vip/lis', 'userVIPController@lis');
    Route::get('home/userWorks_write', 'userWorks_writeController@show');
    Route::any('home/userTalk/lll/{id?}', 'userTalkController@show');
    Route::get('home/message/{id}', 'messageController@show');
    Route::any('home/feiq','userHomeController@qq');//接口qq号码
    Route::get('home/message/del/{id}', 'messageController@del');
    Route::get('home/press/{id}','pressController@select');
    Route::any('home/weblog/{id}','weBlogController@blog');
    Route::get('home/weblog/del/{id}','weBlogController@DEL');
    Route::get('home/userHome/{id}','userHomeController@out');
    Route::any('home/userHome/pass/{id}','userHomeController@pass');
    Route::get('home/message/delall/{id}', 'messageController@delall');
    Route::get('home/userTalk/delall/{id}', 'userTalkController@delall');

});
});



//Route::group(['prefix'=>'home','namespace'=>'Home'],function(){
//    Route::get('index','HomeController@index');
//    Route::get('sort','HomeController@sort');
//    Route::get('login','HomeController@login');
//    Route::get('logon','HomeController@logon');
//    Route::post('adduser','HomeController@adduser');
//});

//后台权限管理
Route::group(['middleware' => 'BackLogin'], function () {
    Route::group(['prefix' => 'back', 'namespace' => 'back'], function () {
//Route::group()
        Route::get('index', 'BackController@index'); //后台主页
        Route::get('power', 'BackController@power')->middleware('rbac');  //权限主页
        Route::any('role', 'BackController@role')->middleware('rbac'); //角色主页
        Route::get('strator', 'BackController@strator')->middleware('rbac'); //管理管理主页
        Route::any('addstrator', 'BackController@addstrator');//新增管理原
        Route::any('addpower', 'BackController@addpower');
        Route::any('updatapower/{id}', 'BackController@updatapower');
        Route::get('deletepower/{id}', 'BackController@deletepower');
        Route::get('addrole', 'BackController@addrole');
        Route::any('adddd', 'BackController@adddd');
        Route::any('roledelete/{idrole}', 'BackController@roledelete');
        Route::any('updatarole/{id}', 'BackController@roleupdata');
        Route::any('deal/{idrole}', 'BackController@deal');
        Route::get('setse', 'BackController@setse');
        Route::any('userdeal/{iduser}', 'BackController@userdeal');


        //后台读者用户管理
        Route::group(['prefix' => 'read'], function () {
            Route::get('news', 'ReaduserController@news')->middleware('rbac'); //读者信息
            Route::any('addreaduser', 'ReaduserController@adduser')->middleware('rbac'); //增加读者用户
            Route::any('upreaduser/{id}', 'ReaduserController@upreaduser');
            Route::get('delreaduser/{id}', 'ReaduserController@delreaduser');
//            Route::post('doaddreaduser','ReaduserController@doadduser');
            Route::any('purchase','ReaduserController@purchase')->middleware('rbac'); //读者订单
            Route::any('gomoney','ReaduserController@gomoney')->middleware('rbac'); //读者充值
            Route::any('statuser/{id}','ReaduserController@statuser');
        });

        //后台作家中心管理
        Route::group(['prefix'=>'center'],function(){
            Route::any('course','MianController@course')->middleware('rbac');   //课程
            Route::any('add_course','MianController@add_course');  //添加课程
            Route::any('edit_course/{id}','MianController@edit_course');  //修改课程
            Route::any('del_course/{id}','MianController@del_course');  //修改课程
            Route::any('special','MianController@special')->middleware('rbac'); //专栏
            Route::any('add_special','MianController@add_special');     //添加专栏
            Route::any('edit_special/{id}','MianController@edit_special');   //修改专栏
            Route::any('del_special/{id}','MianController@del_special');     //删除专栏
            Route::any('infomation','MianController@infomation')->middleware('rbac');       //资讯
            Route::any('add_infomation','MianController@add_infomation');   //添加资讯
            Route::any('edit_infomation/{id}','MianController@edit_infomation');    //修改资讯
            Route::any('del_infomation/{id}','MianController@del_infomation');    //删除资讯
            Route::any('home_figure','MianController@home_figure')->middleware('rbac'); //前台轮播图管理
            Route::any('update_figure','MianController@update_figure'); //跟新轮播图
        });



        //后台作家管理
        Route::group(['prefix' => 'writer'], function () {
            Route::get('userList','WriterController@userList')->middleware('rbac'); //作家信息
            Route::any('useradd','WriterController@add')->middleware('rbac'); //添加作家
            Route::any('userUpdate/{id}','WriterController@Update');
            Route::get('userdel/{id}','WriterController@del');
            Route::get('userTalk','WriterController@talk')->middleware('rbac'); //作家咨询
            Route::get('userTalk/{id}','WriterController@delete');
            Route::any('userAnswer/{id}','WriterController@answer');
            Route::get('books','WriterController@book')->middleware('rbac'); //作家书籍信息
            Route::get('books/drop/{id}','WriterController@drop');
            Route::get('books/desc','WriterController@orderby');
            Route::get('myBook/{id}','WriterController@mybook');
            Route::get('myBook/del/{id}','WriterController@clear');
            Route::get('myBook/desc/{id}','WriterController@order');
            Route::get('book_txt/{id}','TxtController@show');
            Route::get('book_txt/del/{id}','TxtController@del');
            Route::get('book_txt/desc/{id}','TxtController@orderby');
            Route::get('book_novel/{id}','WriterController@show');
            Route::get('userList/back','WriterController@back');
            Route::get('myBook/jump/{id}','WriterController@jump');
            Route::any('publish','WriterController@push')->middleware('rbac'); //作家新闻
            Route::get('newList','WriterController@newlist')->middleware('rbac');//新闻管理
            Route::get('newList/del/{id}','WriterController@delNew');
            Route::get('newDist/{id}','WriterController@look');
            Route::get('income','WriterController@money')->middleware('rbac'); //作家收入
            Route::get('money/{id}','WriterController@writerMoney');
            Route::get('weblog/{id}','WeBlogController@blog');
            Route::get('weblog/del/{id}','WeBlogController@blogDel');
            Route::get('userDetails/{id}','WriterController@details');
            Route::get('userDetails/chop/{id}','WriterController@chop');
            Route::get('flowing','flowingController@show')->middleware('rbac'); //作家专区轮播图
            Route::any('flowing/lll','flowingController@swap');
        });

        //出版社管理
        Route::group(['prefix'=>'presss'],function(){
            Route::get('newpresss','PressController@newpress');//出版社管理
            Route::any('addpresss','PressController@addpresss');//新增出版社
            Route::any('uppresss/{id}','PressController@uppresss');//出版社修改
            Route::get('delpresss/{id}','PressController@delpresss');//出版社修改
        });

        //反馈管理
        Route::get('feedback','BackController@feedback');//反馈
        Route::any('infeedback/{id}','BackController@infeedback');//回复
        Route::get('gofe','BackController@gofe'); //ajax查看反馈
        Route::get('delfeed/{id}','BackController@delfeed');//删除反馈
    });

});

Route::any('back/login', 'back\BackController@login');

//    前台开始------------------------------------------------------------------------
Route::group(['prefix' => 'home', 'namespace' => 'home'], function () {
    Route::get('index', 'HomeController@index');
    Route::any('search', 'HomeController@search');//精准搜索
    Route::get('indexpress','HomeController@indexpress'); //出版社
    Route::get('sort/{id?}/{do?}', 'HomeController@sort');   //分类
//    Route::get('class/{id}','HomeController@sort');   //选择分类
    Route::get('list/{type}', 'HomeController@lists');  //榜单
    Route::get('press', 'HomeController@press'); //出版社
    Route::get('domain', 'HomeController@domain');//出版社中的子模板
    Route::any('message/{id}', 'HomeController@message');//商品详情信息
    Route::any('message/{id}', 'HomeController@message');//商品详情信息
    Route::any('piddetails', 'HomeController@piddetails');//商品详情信息选择书章
    Route::post('dashang','HomeController@dashang'); //打赏作者
    Route::get('ingo/{id}', 'HomeController@ingo');//下载免费小说
    Route::post('message/collers/go', 'HomeController@collers');//用户收藏书籍ajax
    Route::post('person/uncoller','PersonController@uncollers')->middleware('Readuser'); //用户取消收藏ajax

    Route::get('person', 'HomeController@person')->middleware('Readuser'); ///个人中心
    Route::any('Person/means','PersonController@means')->middleware('Readuser');    //个人详情
    Route::get('perfect', 'HomeController@perfect')->middleware('Readuser'); //完善信息
    Route::get('person_edit', 'HomeController@person_edit')->middleware('Readuser'); //修改信息
    Route::get('history', 'HomeController@history')->middleware('Readuser'); //登陆历史
    Route::any('comment', 'HomeController@comment');//增加评论点赞
    Route::get('chapters', 'HomeController@chapters');//章节
    Route::any('logon', 'HomeController@logon'); //登入
    Route::post('login/zhanghu', 'HomeController@zhanghu'); //登入
    Route::get('qq', 'qqController@qq'); //qq登入
    Route::any('login', 'HomeController@login'); //注册
    Route::get('sendSMS', 'HomeController@sendSMS');
    Route::get('logonsendSMS', 'HomeController@logonsendSMS');
    Route::get('article/{id}/{do?}/{newtext?}', 'HomeController@article'); //书籍正文,书章
    Route::get('articlelist', 'HomeController@articlelist'); //书籍正文,书章
    Route::any('read/chat', 'HomeController@chat'); //书籍正文的聊天室ajax
    Route::get('color/back', 'HomeController@color'); //书籍正文的背景ajax
    Route::get('font/size', 'HomeController@size'); //书籍正文的的字体大小ajax
    Route::post('read/chatshow', 'HomeController@chatshow'); //书籍正文的聊天室实时刷新
    Route::get('out', 'HomeController@out');//退出登入


    //个人中心
    Route::any('Person/goin', 'PersonController@goin');//登入
    Route::any('Person/newpwd', 'PersonController@newpwd')->middleware('Readuser');//修改密码
    Route::any('Person/newtel', 'PersonController@newtel')->middleware('Readuser');//修改号码
    Route::get('Person/PersonSMS', 'PersonController@PersonSMS')->middleware('Readuser');//验证码

    Route::any('Person/userIcon', 'PersonController@userIcon')->middleware('Readuser');  //修改头像
    Route::any('Person/order', 'PersonController@order')->middleware('Readuser');        //我的订单
    Route::get('Person/recharge','PersonController@recharge')->middleware('Readuser');   //充值中心
    Route::post('Person/money','PersonController@money')->middleware('Readuser');   //充值中心
    Route::post('Person/upread','PersonController@upread')->middleware('Readuser'); //完善信息
    Route::get('user/vip/lis', 'userVIPController@lis');//四级联动
    Route::get('Person/records','PersonController@records')->middleware('Readuser'); //历史记录
    Route::any('Person/feedback','PersonController@feedback')->middleware('Readuser'); //意见反馈
    Route::get('Person/kkkfeed','PersonController@kkkfeed');//查看后台评论ajax
    Route::get('Person/ajaxfeedback','PersonController@ajaxfeedback')->middleware('Readuser');//查看子级的意见反馈
//    any('Person/goinuserIcon', 'PersonController@gouserIcon'); //头像确认上传
});
Route::get('home/message/into/{id}/{do}/{newtext}', 'home\HomeController@article');
//Route::get('{id}/{do}/{newtext}', 'home\HomeController@article');
//    前台结束------------------------------------------------------------------------


//  zjx张家信
Route::group(['prefix' => 'zjxhome', 'namespace' => 'zjxhome'], function () {
    //前台的路由
    Route::any('index', 'IndexController@index'); //访问首页
    Route::get('course', 'IndexController@course'); //访问课程
    Route::get('special', 'IndexController@special'); //访问专栏
    Route::get('consult', 'IndexController@consult'); //访问咨询
    Route::get('go_course/{id}/{do}','IndexController@go_course');  //去上课

    //登陆注册
    Route::get('login', 'IndexController@login');
    Route::post('doLogin', 'IndexController@doLogin');
    Route::get('register', 'IndexController@register');
    Route::post('store', 'IndexController@store');
});